package com.kunchi.oms.order.service;

import com.kunchi.isb.base.exception.ISBException;
import com.kunchi.oms.order.dao.OrderMapper;
import com.kunchi.oms.order.po.Order;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class OrderService {
    @Autowired
    OrderMapper mapper;


    public List<Order> findAll(){
        return mapper.findAll();
    }

    public List<Order> findByStatusAndPrice(Order order){
        return mapper.findByStatusAndPrice(order);
    }


    public void add(Order order){
        if(StringUtils.isEmpty(order.getOrderStatus())){
            order.setOrderStatus("no_complete");
        }
        mapper.add(order);
    }


    public void update(Order order) {
        mapper.update(order);
    }


    public List<Order> ex(Order order){
        return mapper.ex(order);
    }
}
